package entity;

import lombok.Data;
import org.bson.types.ObjectId;
import org.mongodb.morphia.annotations.Entity;
import org.mongodb.morphia.annotations.Id;

import java.util.Date;

@Data
@Entity("products")
public class Product {
    @Id
    private ObjectId id;
    private String idProduct;
    private String name;
    private Double price;
    private Long sum;
    private Long visitCount;
    private int status;
    private Date addDate;
    private String info;
    private String imageUrl;
    private Long saleCount;

    public Product(ObjectId id, String name, Double price, Long sum, Long visitCount, int status, Date addDate, String info, String imageUrl) {
        this.id = id;
        this.name = name;
        this.price = price;
        this.sum = sum;
        this.visitCount = visitCount;
        this.status = status;
        this.addDate = addDate;
        this.info = info;
        this.imageUrl = imageUrl;
    }

    public Product() {
    }

    public Product(ObjectId id, String name, Double price, Long sum, Long visitCount, int status, Date addDate, String info) {
        this.id = id;
        this.name = name;
        this.price = price;
        this.sum = sum;
        this.visitCount = visitCount;
        this.status = status;
        this.addDate = addDate;
        this.info = info;
    }

    public Product(String name, Double price, Long sum, Long visitCount, int status, Date addDate, String info) {

        this.name = name;
        this.price = price;
        this.sum = sum;
        this.visitCount = visitCount;
        this.status = status;
        this.addDate = addDate;
        this.info = info;
    }

    @Override
    public String toString() {
        return "Products{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", price=" + price +
                ", sum=" + sum +
                ", visitCount=" + visitCount +
                ", status=" + status +
                ", addDate=" + addDate +
                ", info='" + info + '\'' +
                ", imageUrl='" + imageUrl + '\'' +
                '}';
    }


}
